<template>
    <div>
        <!-- 系统作业 -->
        <div class="all-container">
            <!-- 表格栏 -->
            <avue-crud :data="osList.data" :option="osList.option" v-model="avTable">
           <template slot-scope="scope" slot="name">
                <div>{{scope.row.name}}</div>
                <div>{{scope.row.last_run_time}}</div>
            </template>
           <template slot-scope="scope" slot="is_enable">
                <el-select v-model="isNOList[key]" placeholder="" size="mini" style="width:80px">
                    <el-option label="是" value="yes"></el-option>
                    <el-option label="否" value="no"></el-option>
                </el-select>
            </template>
            <template slot-scope="scope" slot="execution_time">
                <el-time-select
                    v-model="modTime"
                    :picker-options="{
                        start: '08:30',
                        step: '00:15',
                        end: '18:30'
                    }"
                    placeholder="选择时间" size="mini">
                </el-time-select>
            </template>
            </avue-crud>
        </div>
    </div>
</template>

<script>
export default {
  data: function() {
    return {
        avTable:{},
        osList:{
            data:[],
            option:{
                page:false,
                align:'center',
                menu:false,
                menuAlign:'center',
                column:[
                    {
                        label:"作业名称",
                        prop:"name",
                        solt:true
                    },
                    {
                        label:"启用",
                        prop:"is_enable",
                        solt:true
                    },
                    {
                        label:"执行时间",
                        prop:"execution_time",
                        solt:true
                    },
                ]
            }
        },
        modTime:"",
        isNO:"",
        isNOList:{}
    };
  },
  methods: {
      getOsList(){
          this.getRequest("/sys/task/list").then(data=>{
              console.log(data);
              this.osList.data=data.data
          });
      },
      setisNoList(){
          for(var item of this.osList.data){
              this.isNOList.push("no");
          }
      }
  },
  computed: {},
  watch: {},
  created(){
      for(var key in this.avTable){
          this.$set(this.isNOList,key,[])
      }
  },
  mounted() {
      console.log("oswork");
      this.getOsList();
      this.setisNoList();
      this.$emit("sendActive", "3-4");
  }
};
</script>
<style scoped src="../../assets/css/allManage/oswork.css">
</style>